package Demo03;

import java.util.Comparator;

/**
 * @ClassName AgeComparator
 * @Description TODO
 * @Author 李明忠
 * @Date 2025/5/5 16:05
 * @Version 1.0
 */
public class AgeComparator implements Comparator<Student> {

    /**
     * @param o1 the first object to be compared.
     * @param o2 the second object to be compared.
     * @return
     */
    @Override
    public int compare(Student o1, Student o2) {
        return o1.age - o2.age;
    }
}
